import { createContext } from 'react';

import { ModalId } from '@/shared/lib/modals';

interface ModalContextProps<T> {
  openModal: (id: ModalId) => void;
  closeModal: () => void;
  id: ModalId | null;
  data: T;
  setData: (p: () => T) => void;
}

export const ModalContext = createContext<ModalContextProps<any>>({
  openModal: () => {},
  closeModal: () => {},
  id: null,
  data: null,
  setData: () => {},
});
